import { defineStore } from 'pinia'

const useArticleStore = defineStore('article', {
  state: () => {
    return {
      articleFormVisible: false,
      editFormVisible: false,
    }
  },
  actions: {
    articleVisibleController(flag: boolean) {
      if (flag) {
        this.articleFormVisible = true
      } else {
        this.articleFormVisible = false
      }
    },
    editVisibleController(flag: boolean) {
      if (flag) {
        this.editFormVisible = true
      } else {
        this.editFormVisible = false
      }
    },
  },
})

export default useArticleStore
